package main

import (
	"fmt"
	"gitee.com/amoyx/cloud-provider/config"
	"gitee.com/amoyx/cloud-provider/pkg/cloud"
	"gitee.com/amoyx/cloud-provider/pkg/cloud/huawei/models"
)

func main() {
	config.Viper()
	ak := config.Config.HuaweiCloud.SecretId
	sk := config.Config.HuaweiCloud.SecretKey
	//
	args := models.LogCollectRequest{
		Name:        "collect-demo001",
		LogGroupId:  "d465e816-54fd-4177-8f39-f5e03b7ee97d",
		LogStreamId: "20b4aead-5794-4b9f-bb0e-a57f20780a53",
		Namespace:   "default",
		ClusterId:   "b4ff1e2e-d921-11ee-b773-0255ac1002c3",
	}

	client := cloud.NewCloudClient(ak, sk)
	id, err := client.
		HuaweiCloud().
		LogServices().
		LogCollect("cn-east-3").
		CreateCollectConfig(args)

	if err != nil {
		fmt.Printf("%+v", err)
		return
	}
	fmt.Println(id)
}
